コード例 #1
0
ReportPrintSetting::ReportPrintSetting(QObject *parent) :
    QObject(parent)
{

    m_tableView = new QTableView();
    m_tableModel = new QStandardItemModel(this);
    initTableView();
}
コード例 #2
0
bool BalloonRankDialog::init()
{
	bool bRet = false;
	do
	{
		CC_BREAK_IF(!DialogLayer::init());
		CCNodeLoaderLibrary* pLoaderLib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();

		CCBReader* pCCBReader = new CCBReader(pLoaderLib);

		std::string strCCBFileName = "BalloonRankDialog.ccbi";

		const std::vector<std::string> vSearchOrder = CCFileUtils::sharedFileUtils()->getSearchResolutionsOrder();

		std::string strCCBRootPath = vSearchOrder[0];

		pCCBReader->setCCBRootPath(strCCBRootPath.c_str());

		CCNode* pNode = pCCBReader->readNodeGraphFromFile(strCCBFileName.c_str(), this);

		if (pNode != NULL)
		{
			this->addChild(pNode);
		}

		pCCBReader->release();
		
		setKeypadEnabled(true);

		initLabelTTF();
        
        initTableView();
        
        initMenu();
        
        // start fire
        CCArray* pArrayFire = CCArray::createWithCapacity(6);
        for (int idx = 1; idx <= 6; ++idx)
        {
            pArrayFire->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(CCString::createWithFormat("energy_fire%d.png", idx)->getCString()));
        }
        CCAnimation* pAnimation = CCAnimation::createWithSpriteFrames(pArrayFire, 0.1f);
        CCAnimate* pAnimateFire = CCAnimate::create(pAnimation);
        m_pSpriteScoreFire->runAction(CCRepeatForever::create(pAnimateFire));
        
        // set animation onEnter and onExit
        m_pMainBoard = m_pSpriteBoard;
        m_pSpriteBoard->setScale(0.01f);
        setOnEnterAction(CCEaseBounceOut::create(CCScaleTo::create(0.5f, 1.0f)));
        setOnExitAction(CCEaseExponentialIn::create(CCScaleTo::create(0.5f, 0.01f)));
		
		bRet = true;
		
	} while(0);
	
	return bRet;
}
コード例 #3
0
void Matrix::initTable(int rows, int cols)
{
    initGlobals();
	d_view_type = TableView;

    d_matrix_model = new MatrixModel(rows, cols, this);
    initTableView();

	// resize the table
	setGeometry(50, 50, QMIN(_Matrix_initial_columns_, cols)*d_table_view->horizontalHeader()->sectionSize(0) + 55,
                (QMIN(_Matrix_initial_rows_,rows)+1)*d_table_view->verticalHeader()->sectionSize(0));
}
コード例 #4
0
ProcessListWidget::ProcessListWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ProcessListWidget)
, itemModel()
{
    ui->setupUi(this);
    this->resize(540, 360);

    initTableView();
    initConnection();
    refreshTableItems();
}
コード例 #5
0
ProcessInfoForm::ProcessInfoForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ProcessInfoForm),
    mItemModel(),
    mMenu(NULL),
    mProcessInfo(NULL),
    mCurProcess()
{
    ui->setupUi(this);

    mProcessInfo = SystemInfoProvider::getInstance()->getProcessInfo();

    ui->rdoAllProcess->setChecked(true);
    initTableView();
    initConnection();
    refreshViews();
}
コード例 #6
0
void Matrix::setViewType(ViewType type, bool renderImage)
{
	if (d_view_type == type)
		return;

	d_view_type = type;

	if (d_view_type == ImageView){
		delete d_table_view;
		delete d_select_all_shortcut;
	    initImageView();
		if (renderImage)
			displayImage(d_matrix_model->renderImage());
		d_stack->setCurrentWidget(imageLabel);
	} else if (d_view_type == TableView){
		delete imageLabel;
	    initTableView();
	    d_stack->setCurrentWidget(d_table_view);
	}
	emit modifiedWindow(this);
}
コード例 #7
0
ファイル: DMachine.cpp プロジェクト: JinduYin/DoorsMachine
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    initWidget();
    initTableView();
    readAndSetStyleSheet();
    this->setWindowIcon(QIcon(":/Resources/img/logo.ico"));

    timer = NULL;
    retSize = "";
    startValue = true;
    timer = new QTimer(this);

    _sql = new MysqlQuery();
    _sql->openMysql(DATABASE_NAME);

    exePath = QCoreApplication::applicationDirPath();
    QString imagePath = exePath;
    logPath = exePath;
    logPath.append("/yqclog.log");
    imagePath.append("/image/" );
    QDir dir(imagePath);
    if(!dir.exists())
        dir.mkpath(imagePath);

    initValue();
//    connect(timer, &QTimer::timeout, this, &MainWindow::timeOver);

    _instance = new VlcInstance(VlcCommon::args(), this);
    _player = new VlcMediaPlayer(_instance);
    _player->setVideoWidget(ui->widget_mp4Video);

    ui->widget_mp4Video->setMediaPlayer(_player);
    ui->widget_mp4Volume->setMediaPlayer(_player);
    ui->widget_mp4Volume->setVolume(50);
    ui->widget_mp4Seek->setMediaPlayer(_player);
    ui->pushButton_stop->setEnabled(false);
}
コード例 #8
0
CoaSettingsWidgetChangeDebug::CoaSettingsWidgetChangeDebug(QWidget * const parent , Qt::WFlags f )
: CoaSettingsWidget (parent, f)
,actionModel(0)
{
   BEGIN;

   //Create the central form
   Q_INIT_RESOURCE(tools);
   CoaFormFactory factory(this);
   factory.formBuild(":/tools/settings/coachangedebug.ui");
   setIcon(":/tools/settings/icons/debug.png");

   initMainButtons();
   initDefaultModeButtons();

   loadModel();
   assert(actionModel);

   initTableView();
   setShortName( tr("Debug") );
   setGroupName( shortName() );

}
コード例 #9
0
ファイル: dlgprefcontroller.cpp プロジェクト: Drakeo/mixxx
DlgPrefController::DlgPrefController(QWidget* parent, Controller* controller,
                                     ControllerManager* controllerManager,
                                     UserSettingsPointer pConfig)
        : DlgPreferencePage(parent),
          m_pConfig(pConfig),
          m_pControllerManager(controllerManager),
          m_pController(controller),
          m_pDlgControllerLearning(NULL),
          m_pInputTableModel(NULL),
          m_pInputProxyModel(NULL),
          m_pOutputTableModel(NULL),
          m_pOutputProxyModel(NULL),
          m_bDirty(false) {
    m_ui.setupUi(this);

    initTableView(m_ui.m_pInputMappingTableView);
    initTableView(m_ui.m_pOutputMappingTableView);
    initTableView(m_ui.m_pScriptsTableWidget);

    connect(m_pController, SIGNAL(presetLoaded(ControllerPresetPointer)),
            this, SLOT(slotPresetLoaded(ControllerPresetPointer)));
    // TODO(rryan): Eh, this really isn't thread safe but it's the way it's been
    // since 1.11.0. We shouldn't be calling Controller methods because it lives
    // in a different thread. Booleans (like isOpen()) are fine but a complex
    // object like a preset involves QHash's and other data structures that
    // really don't like concurrent access.
    ControllerPresetPointer pPreset = m_pController->getPreset();
    slotPresetLoaded(pPreset);

    m_ui.labelDeviceName->setText(m_pController->getName());
    QString category = m_pController->getCategory();
    if (!category.isEmpty()) {
        m_ui.labelDeviceCategory->setText(category);
    } else {
        m_ui.labelDeviceCategory->hide();
    }

    // When the user picks a preset, load it.
    connect(m_ui.comboBoxPreset, SIGNAL(activated(int)),
            this, SLOT(slotLoadPreset(int)));

    // When the user toggles the Enabled checkbox, toggle.
    connect(m_ui.chkEnabledDevice, SIGNAL(clicked(bool)),
            this, SLOT(slotEnableDevice(bool)));

    // Connect our signals to controller manager.
    connect(this, SIGNAL(openController(Controller*)),
            m_pControllerManager, SLOT(openController(Controller*)));
    connect(this, SIGNAL(closeController(Controller*)),
            m_pControllerManager, SLOT(closeController(Controller*)));
    connect(this, SIGNAL(loadPreset(Controller*, ControllerPresetPointer)),
            m_pControllerManager, SLOT(loadPreset(Controller*, ControllerPresetPointer)));

    // Input mappings
    connect(m_ui.btnAddInputMapping, SIGNAL(clicked()),
            this, SLOT(addInputMapping()));
    connect(m_ui.btnRemoveInputMappings, SIGNAL(clicked()),
            this, SLOT(removeInputMappings()));
    connect(m_ui.btnLearningWizard, SIGNAL(clicked()),
            this, SLOT(showLearningWizard()));
    connect(m_ui.btnClearAllInputMappings, SIGNAL(clicked()),
            this, SLOT(clearAllInputMappings()));

    // Output mappings
    connect(m_ui.btnAddOutputMapping, SIGNAL(clicked()),
            this, SLOT(addOutputMapping()));
    connect(m_ui.btnRemoveOutputMappings, SIGNAL(clicked()),
            this, SLOT(removeOutputMappings()));
    connect(m_ui.btnClearAllOutputMappings, SIGNAL(clicked()),
            this, SLOT(clearAllOutputMappings()));

    // Scripts
    connect(m_ui.m_pScriptsTableWidget, SIGNAL(cellChanged(int, int)),
            this, SLOT(slotDirty()));
    connect(m_ui.btnAddScript, SIGNAL(clicked()),
            this, SLOT(addScript()));
    connect(m_ui.btnRemoveScript, SIGNAL(clicked()),
            this, SLOT(removeScript()));
    connect(m_ui.btnOpenScript, SIGNAL(clicked()),
            this, SLOT(openScript()));
}