Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#include "mainwidget.h"
2
3#include <QApplication>
4#include <QLabel>
5#include <QTimer>
6
7#include "TSystem.h"
8#include "TEnv.h"
9#include "TQt6GuiFactory.h"
10
11int main(int argc, char *argv[])
12{
13 QApplication myapp(argc, argv);
14
15 // temporary here, graphics libs no longer loaded by TCanvas
16 gEnv->SetValue("Gui.Factory", "qt6");
17 gEnv->SetValue("Root.PadEditor", "qt6");
18
20
21 // let run ROOT event loop
22 QTimer timer;
23 QObject::connect(&timer, &QTimer::timeout, []() {
25 });
26 timer.setSingleShot(false);
27 timer.start(10); // how often ROOT events will be processed
28
30 w.setWindowTitle("Main Widget");
31 w.resize(800, 500);
32
33 QObject::connect(&myapp, &QApplication::lastWindowClosed, &myapp, &QApplication::quit);
34
35 w.show();
36 return myapp.exec();
37}
38
R__EXTERN TEnv * gEnv
Definition TEnv.h:126
R__EXTERN TGuiFactory * gGuiFactory
Definition TGuiFactory.h:68
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Definition TEnv.cxx:753
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:420
int main()
Definition main.cpp:18